package com.fast.user.model.admin;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.fast.base.db.model.Commnent;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 权限表
 * 
 * @author Administrator
 */
@Entity
@Table(name = "T_dv_Permission")
@DynamicInsert(true)
@DynamicUpdate(true)
public class Permission implements java.io.Serializable {
	/**
	 * serialVersionUID:提示:.
	 * 
	 * @since JDK 1.7
	 */
	private static final long serialVersionUID = -888972003847705179L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false, length = 10)
	private int id;
	private String uuid;
	private String parentUUID;
	private String parentName;
	private String psmCode;
	private String psmName;
	private String psmDesc;
	private String psmUrl;
	private String psmIcon;
	private int showPosition = 0;
	@Column(length = 4000)
	private String btnArray;// 链接按钮
	private int grade;
	private int orderNo;
	private int psmType;
	private int viewMode = 1;// 1为显示 0为不显示

	// 操作信息
	@Commnent("编辑人ID")
	@Column(name = "editor_id", length = 11)
	private int editorId = 0;// 编辑人Id
	@Commnent("编辑人")
	@Column(name = "editor_name", length = 32)
	private String editorName = "";// 编辑人
	@Commnent("编辑时间")
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "edit_time")
	private Date editTime;// 编辑时间
	@Commnent("创建人ID")
	@Column(name = "creater_id", length = 11)
	private int createrId = 0;// 编辑人Id
	@Commnent("创建人")
	@Column(name = "creater", length = 32)
	private String creater = "";// 编辑人
	@Commnent("创建时间")
	@Column(name = "create_time", length = 32)
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	@Commnent("删除标识")
	@Column(name = "delete_flag", length = 1)
	private int deleteFlag = 0;// 默认为不删除，1为删除

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getParentUUID() {
		return parentUUID;
	}

	public void setParentUUID(String parentUUID) {
		this.parentUUID = parentUUID;
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public String getPsmCode() {
		return psmCode;
	}

	public void setPsmCode(String psmCode) {
		this.psmCode = psmCode;
	}

	public String getPsmName() {
		return psmName;
	}

	public void setPsmName(String psmName) {
		this.psmName = psmName;
	}

	public String getPsmDesc() {
		return psmDesc;
	}

	public void setPsmDesc(String psmDesc) {
		this.psmDesc = psmDesc;
	}

	public String getPsmUrl() {
		return psmUrl;
	}

	public void setPsmUrl(String psmUrl) {
		this.psmUrl = psmUrl;
	}

	public int getGrade() {
		return grade;
	}

	public void setGrade(int grade) {
		this.grade = grade;
	}

	public int getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(int orderNo) {
		this.orderNo = orderNo;
	}

	public int getPsmType() {
		return psmType;
	}

	public void setPsmType(int psmType) {
		this.psmType = psmType;
	}

	public int getEditorId() {
		return editorId;
	}

	public void setEditorId(int editorId) {
		this.editorId = editorId;
	}

	public String getEditorName() {
		return editorName;
	}

	public void setEditorName(String editorName) {
		this.editorName = editorName;
	}


	public int getCreaterId() {
		return createrId;
	}

	public void setCreaterId(int createrId) {
		this.createrId = createrId;
	}

	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	public String getPsmIcon() {
		return psmIcon;
	}

	public void setPsmIcon(String psmIcon) {
		this.psmIcon = psmIcon;
	}

	public int getViewMode() {
		return viewMode;
	}

	public void setViewMode(int viewMode) {
		this.viewMode = viewMode;
	}

	public String getBtnArray() {
		return btnArray;
	}

	public void setBtnArray(String btnArray) {
		this.btnArray = btnArray;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")  public Date getEditTime() {
		return editTime;
	}

	public void setEditTime(Date editTime) {
		this.editTime = editTime;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public int getDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(int deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	public int getShowPosition() {
		return showPosition;
	}

	public void setShowPosition(int showPosition) {
		this.showPosition = showPosition;
	}
}
